var frisby = require('frisby');
var uuid = require('uuid');

var deviceID = uuid.v1();

frisby.create('注册一个新设备')
    .post('http://192.168.247.88:9090/hub/device/register',{
        'device-udid':deviceID,
        'device-name':'AUTOMATIC TEST'
      })
    // .inspectJSON()
    .expectJSON({
        "result":{
          "value":"success",
          "info":"注册成功"
        }})
.toss()

frisby.create('重复注册一个设备')
    .post('http://192.168.247.88:9090/hub/device/register',{
        'device-udid':deviceID,
        'device-name':'AUTOMATIC TEST'
      })
    .expectJSON({
        "result":{
          "value":"error"
        }})
  .toss()
